package com.fans.springaop.controller;

import javax.annotation.Resource;
import javax.websocket.server.PathParam;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fans.springaop.entity.User;
import com.fans.springaop.service.UserService;

@Controller
public class UserController {
	
	@Resource
	private UserService userService;
	
	@ResponseBody
	@RequestMapping("/user/{id}")
	public User getUser(@PathParam(value = "id") String id){
		User user = userService.getUserById(id);
		return user;
	}
}
